/*
 * @Author: 
 * @Date: 2022-01-26 14:00:12
 * @LastEditors: lqj
 * @LastEditTime: 2022-02-10 14:51:10
 * @Description: 循环渲染
 */
import React, { Component } from 'react';
import Item from './Item'
import PropTypes from 'prop-types'

class List extends Component {
  static propTypes = {
    setCheck: PropTypes.func.isRequired,
    todoList: PropTypes.array.isRequired
  }
  render() {
    const { todoList, deleteItem, setCheck } = this.props
    return (
      <>
        <ul className='todo-main'>
          {
            todoList.map((it, i) => {
              return <Item key={it.id} item={it} deleteItem={deleteItem} setCheck={setCheck}></Item>
            })
          }
        </ul>
      </>
    );
  }
}

export default List;
